<template>
  <div>
    <div style="border-bottom:1px solid black;font-size:large;">精选好评</div>
    <!-- ------------------------------------ -->
    <div>
      <div v-for="(i,index) in this.list" :key="index">
        <div class="b">
          <!--文本-->
          {{i.text}}
        </div>
        <div class="c">
          <!--商品图片1-->
          <img :src=i.url  class="im" alt="" />
        </div><van-divider style="clear: both">-------------------</van-divider>
      </div>
      
    </div>
    <!-- ------------end of 循环----------------- -->
    <div style="height:37px"></div>
  </div>
</template>
<script>

import pl from '@/api/Pinglun'
export default {
  data() {
    return {
      loading: true,
      list:[]
    };
  },
  created(){
    pl.getAll().then(res=>{
      console.log(res.data)
      for(var i=0;i<res.data.length;i++){
        let L ={
          text:res.data[i].text,
          url:res.data[i].url
        }
        this.list.push(L)
      }
    })
  },

  methods: {
    sw() {
      if (this.loading == false) {
        this.loading = true;
      } else {
        this.loading = false;
      }
    },
  },
};
</script>
<style scoped>
.a {
  float: left;
  width: 50px;
}
.b {
  height: 100px;
  width: 275px;
  float: left;
  border-left: 1px solid orangered;
  word-break: break-all;
}
.c {
  border-left: 1px solid orangered;
  width: 90px;
  float: left;
}
.im {
  width: 90px;
  height: 100px;
}
</style>